<%@ page contentType="text/html; charset=UTF-8" pageEncoding="utf-8"%>
<%@ include file="/common/init.jsp"%>
<div id="conversionlist">
	<div class="vvbt" style="margin-top: 20px;">
		<table width="840" border="0" align="center" cellpadding="0" cellspacing="0">
			<tr>
				<td width="200" class="vvd">转出方</td>
				<td width="200" class="vvd">转入方</td>
				<td width="240" class="vvd">金额</td>
				<!-- <td width="150" class="vvd">手续费</td> -->
				<td width="200" class="vvd">时间</td>
			</tr>
		</table>
	</div>
	<table width="840" border="0" align="center" cellpadding="0" cellspacing="0">
		<c:forEach var="conversion" items="${converList}">
			<tr>
				<td width="200" class="vv">${conversion['user_id']}</td>
				<td width="200" class="vv">${conversion['to_user_id']}</td>
				<td width="240" class="vv">${conversion['amount']}</td>
				<td width="200" class="vv">
					<fmt:formatDate value="${conversion['post_time']}" pattern="yyyy-M-dd HH:mm:ss" />
				</td>
			</tr>
		</c:forEach>
	</table>
	<table width="840" border="0" align="center" cellpadding="0" cellspacing="0">	
	<tr>
		<td class="page">第${pageNo}页&nbsp;&nbsp;
		<c:choose>
			<c:when test="${pageNo>1}">
				<a href="javascript:void(0);" style="text-decoration: none;">
					<span onclick="frontpage(1)">首页</span>&nbsp;
				</a>
				<a href="javascript:void(0);" style="text-decoration: none;">
					<span onclick="frontpage(${pageNo-1})">上一页</span>&nbsp;
				</a>
			</c:when>
			<c:otherwise>
				首页&nbsp;上一页 &nbsp;
			</c:otherwise>
			</c:choose>
			<c:choose>
				<c:when test="${totalPage > pageNo}">	
					<a href="javascript:void(0);" style="text-decoration: none;">
						<span onclick="nextpage(${pageNo+1})">下一页</span> &nbsp;
					</a>
					<a href="javascript:void(0);" style="text-decoration: none;">
						<span onclick="nextpage(${totalPage})">末页</span> &nbsp;
					</a>
				</c:when>
				<c:otherwise>
					下一页&nbsp;末页&nbsp;
				</c:otherwise>
			</c:choose>
			&nbsp;共${totalPage}页&nbsp;&nbsp;共${totalCount}条
			</td>
		</tr>
		</table>
	</div>
<script type="text/javascript">
	function frontpage(pageNo) {
		$.ajax({
			type : 'POST',
			url : "${ctx}/conversionlist.action?pageNo=" + pageNo,
			dataType : "html",
			success : function(data, status) {
				if ($.trim(data) != '') {
					$("#conversionlist").html(data);
				}
			},
			error : function(data, status, e) {
				alert(e.name);
			}
		});
		//window.frames["exchangelist"].location.href = "${ctx}/exchangelist.action?pageNo="+pageNo;
	}

	function nextpage(pageNo) {
		$.ajax({
			type : 'POST',
			url : "${ctx}/conversionlist.action?pageNo=" + pageNo,
			dataType : "html",
			success : function(data, status) {
				if ($.trim(data) != '') {
					$("#conversionlist").html(data);
				}
			},
			error : function(data, status, e) {
				alert(e.name);
			}
		});
		//location = "${ctx}/exchangelist.action?pageNo="+pageNo;
		//window.frames["exchangelist"].location.href = "${ctx}/exchangelist.action?pageNo="+pageNo;
	}
</script>